local strongHurtSkill = fk.CreateSkill {
  name = "strong_hurt_skill",
  tags = { Skill.Compulsory, },
}


-- strongHurtSkill:addEffect(fk.DamageFinished, {
  --   name = "strong_hurt_skill",
  --   anim_type = "control",
  --   frequency = Skill.Compulsory,
  --   events = {fk.DamageFinished,fk.TurnEnd},
  --   can_trigger = function (self, event, target, player, data)
  --     if not player:hasSkill(strongHurtSkill.name) then return end
  --     if event == fk.DamageFinished then
  --       return data.card and data.to and data.to == player and data.to:getMark("@strong_hurt") > 0
  --     else
  --       return player == target
  --     end
  --   end,
  --   on_use = function(self, event, target, player, data)
  --     local room = player.room
  --     if event == fk.DamageFinished then
  --       local tatal_damaged = player:getMark("tatal_damaged")
  --       local per_damage = data.damage / 2
  --       local mod_damage = data.damage % 2
  --       per_damage = per_damage > 0 and math.floor(per_damage) or 0
  --       mod_damage = (mod_damage + tatal_damaged) % 2 == 0 and 1 or 0
  --       room:setPlayerMark(player,"tatal_damaged",tatal_damaged+data.damage)
  --       if per_damage + mod_damage > 0 then
  --         room:damage({
  --           to = player,
  --           damage = per_damage + mod_damage,
  --           damageType = fk.NormalDamage,
  --           skillName = strongHurtSkill.name
  --         })
  --       end
  --     else
  --       local mark = player:getMark("@strong_hurt")
  --        room:setPlayerMark(player,"@strong_hurt",mark-1)
  --       if mark - 1 <= 0 then
  --         room:handleAddLoseSkills(player, "-strong_hurt_skill", nil, false)
  --       end
  --     end
  --   end,
  --
-- })
-- strongHurtSkill:addEffect(fk.TurnEnd, {
  --   name = "strong_hurt_skill",
  --   anim_type = "control",
  --   frequency = Skill.Compulsory,
  --   events = {fk.DamageFinished,fk.TurnEnd},
  --   can_trigger = function (self, event, target, player, data)
  --     if not player:hasSkill(strongHurtSkill.name) then return end
  --     if event == fk.DamageFinished then
  --       return data.card and data.to and data.to == player and data.to:getMark("@strong_hurt") > 0
  --     else
  --       return player == target
  --     end
  --   end,
  --   on_use = function(self, event, target, player, data)
  --     local room = player.room
  --     if event == fk.DamageFinished then
  --       local tatal_damaged = player:getMark("tatal_damaged")
  --       local per_damage = data.damage / 2
  --       local mod_damage = data.damage % 2
  --       per_damage = per_damage > 0 and math.floor(per_damage) or 0
  --       mod_damage = (mod_damage + tatal_damaged) % 2 == 0 and 1 or 0
  --       room:setPlayerMark(player,"tatal_damaged",tatal_damaged+data.damage)
  --       if per_damage + mod_damage > 0 then
  --         room:damage({
  --           to = player,
  --           damage = per_damage + mod_damage,
  --           damageType = fk.NormalDamage,
  --           skillName = strongHurtSkill.name
  --         })
  --       end
  --     else
  --       local mark = player:getMark("@strong_hurt")
  --        room:setPlayerMark(player,"@strong_hurt",mark-1)
  --       if mark - 1 <= 0 then
  --         room:handleAddLoseSkills(player, "-strong_hurt_skill", nil, false)
  --       end
  --     end
  --   end,
  --
-- })


return strongHurtSkill